'use strict';
game.import('character', function (lib, game, ui, get, ai, _status) {
	return {
		name: 'hugelong',
		connect: true,
		characterSort: {
			hugelong: {
				hugelong_normal: ['ya'],
			},
		},
		character: {
			//long
			ya: ['female', 'long', 3, ['lingao', 'tiancheng', 'ya_gongshang']],
		},
		characterIntro: {
			ya: '',
		},
		skill: {
			//联动-通用
			liandong: {

			},
			liandong2: {

			},
			//雅的工商区机制
			ya_gongshang: {
				group: ['ya_gongshang_start', 'ya_gongshang_add', 'ya_gongshang_lose', 'ya_gongshang2', 'ya_guihua', 'liandong'],
				marktext: '㊖',
				intro: {
					name: function (storage, player) {
						return '工商区容量为：' + player.storage.ya_gongshang2;
					},
					content: 'cards',
				},
			},
			ya_gongshang2: {},
			ya_gongshang_start: {
				trigger: {
					global: 'phaseBefore',
					player: 'enterGame',
				},
				forced: true,
				popup: false,
				filter: function (event, player) {
					return (event.name != 'phase' || game.phaseNumber == 0);
				},
				init: function (player) {
					player.storage.ya_gongshang = [];
					player.storage.ya_gongshang2 = 10;
				},
				content: function () {
					var cards=get.cards(2);
					player.markAuto('ya_gongshang', game.cardsGotoSpecial(cards).cards);
					player.markSkill('ya_gongshang');
					game.log(player, '向', '#o' + '工商区', '中初始设置了', cards);
				},
			},
			ya_gongshang_add: {
				trigger: {
					player: 'phaseZhunbeiBegin',
				},
				forced: true,
				popup: false,
				filter: function (event, player) {
					return player.getStorage('ya_gongshang').length < player.storage.ya_gongshang2;
				},
				content: function () {
					var cards = get.cards(player.storage.ya_gongshang2 - player.getStorage('ya_gongshang').length);
					player.markAuto('ya_gongshang', game.cardsGotoSpecial(cards).cards);
					game.log(player, '向', '#o' + '工商区', '中补充了', cards);
				},
			},
			ya_gongshang_lose: {
				trigger: { global: 'dieAfter' },
				forced: true,
				popup: false,
				filter: function (event, player) {
					return game.players.length < player.storage.ya_gongshang2;
				},
				content: function () {
					'step 0'
					var str='请弃置工商区的'+(player.storage.ya_gongshang2-game.players.length)+'张牌';
					player.chooseButton(true, [str, player.storage.ya_gongshang], [player.storage.ya_gongshang2-game.players.length,player.storage.ya_gongshang2-game.players.length]).set('ai', function (button) {
						return -get.value(button)+20;
					});
					'step 1'
					if(result.bool){
						player.storage.ya_gongshang.remove(result.links);
						game.cardsDiscard(result.links);
						player.syncStorage('ya_gongshang');
					}
					'step 2'
					player.storage.ya_gongshang2=game.players.length;
				},
			},
			ya_guihua: {

			},


			lingao: {

			},
			tiancheng: {

			},
		},
		challenge: {
		},
		dynamicTranslate: {
		},
		translate: {
			ya: '雅',
			lingao: '伶骜',
			tiancheng: '天成',
			lingao_info: '12',
			tiancheng_info: '12',


			hugelong_normal: "特典",
			//成就 
		},
	};
});
